package cn.edu.lingnan.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.lingnan.dao.StudentDAO;

public class NameCheckServlet extends HttpServlet {
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String username=req.getParameter("username");
		StudentDAO sd=new StudentDAO();
		boolean flag=sd.findByName(username);
		System.out.println(flag);
		if(flag)
			resp.getWriter().print("true");
		else
			resp.getWriter().print("false");
	}
}
